﻿@using X.PagedList;
@using X.PagedList.Mvc.Core;
@using X.PagedList.Mvc.Common;
@using FwProject.Distribution.Dto.Statistics
@model DriverActualRatioTotalDto
@{
    Layout = null;
    int i = 0;
    //if (Model.Count > 0)
    //{
    //    if (Model.PageNumber != 1)
    //    {

    //        i = (Model.PageNumber - 1) * Model.PageSize;
    //    }
    //}
}
<div id="table_print">

    <table class="table table-bordered table-hover table-rowselected">
        <thead>
            <tr>
                <th style="width:45px">序号</th>
                <th>配送日期</th>
                @*<th>司机名称</th>
                    <th>司机电话</th>*@
                <th>应送</th>
                <th>实送</th>
                <th>实送率（%）</th>
            </tr>
        </thead>
        <tbody>
            @if (Model.DriverActualRatioPagedList.Count == 0)
            {
                <tr><td class="text-center" colspan="5">暂无信息</td></tr>
            }
            else
            {
                foreach (var item in Model.DriverActualRatioPagedList)
                {
                    i++;
                    <tr>
                        <td>@i</td>
                        <td>@item.DistributionDate.ToString("yyyy-MM-dd")</td>
                        @*<td>@item.DriverName</td>
                            <td>@item.DriverPhone</td>*@
                        <td>@item.ShouldSend</td>
                        <td>@item.ActualSnd</td>
                        <td>@item.Proportion</td>
                    </tr>
                }
                <tr class="footer">
                    <td colspan="2" style="color:red;text-align:center">总合计</td>
                    <td style="color:red">@Model.TotalShouldSend</td>
                    <td style="color:red">@Model.TotalActualSnd</td>
                    <td style="color:red">@Model.TotalProportion</td>
                </tr>
            }

        </tbody>
    </table>

</div>
<div class="row pagedinfo">
    <div class="col-sm-5">
        共 @Model.DriverActualRatioPagedList.TotalItemCount 条
        <select class="form-control" id="pageSize" style="width:70px;display:initial">
            @for (int z = 10; z < 100; z = z + 10)
            {
                if (z == Model.DriverActualRatioPagedList.PageSize)
                {
                    <option selected value="@z">@z</option>
                }
                else
                {
                    <option value="@z">@z</option>
                }
            }
        </select> &nbsp; 条/页 当前第 @Model.DriverActualRatioPagedList.PageNumber/@Model.DriverActualRatioPagedList.PageCount 页
    </div>
    <div class="col-sm-7">
        <input type="hidden" id="pageurl" value="&DriverId=@(Context.Request.Query["DriverId"])&beginTime=@(Context.Request.Query["beginTime"])&endTime=@(Context.Request.Query["endTime"])" />
        @Html.PagedListPager(Model.DriverActualRatioPagedList, page => Url.Action("DriverActualRatio", new { pageIdx = page, size = Context.Request.Query["size"], DriverId = Context.Request.Query["DriverId"], beginTime = Context.Request.Query["beginTime"], endTime = Context.Request.Query["endTime"] }), PagedListRenderOptions.EnableUnobtrusiveAjaxReplacing(new AjaxOptions() { AllowCache = false, HttpMethod = "Get", UpdateTargetId = "data_list", OnSuccess = "AjaxSuccessCallback", OnBegin = "AjaxBegin" }))
    </div>
</div>
